package test;

import java.awt.Graphics;
import java.awt.Image;

import javax.swing.JButton;
import javax.swing.JPanel;

public class PanelPic extends JPanel {
	private Image image;
	private String name ="";
	public PanelPic(Image image) {
		super();
		this.image = image;
		this.repaint();
	}

	@Override
	public void paint(Graphics g) {
		super.paint(g);
		g.drawString(name, 10, 15);
		//g.drawImage(image, getWidth() / 2 - (image.getWidth(this) / 2) , getHeight() / 2 - (image.getHeight(this) / 2), this);
	}

	public Image getImage() {
		return image;
	}

	public void setImage(Image image) {
		this.image = image;
		this.repaint();
	}

	public void setName(String name) {
		this.name = name;
	}
	
	
	

	
}
